﻿
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using Model;
using MsDAL;
using System.ComponentModel;

namespace ServiceHelper
{
    [DataObjectAttribute]
    public partial class Sto8a01Manager : Sto8a01Base
    {
        private static Sto8a01Manager _entity;

        public static Sto8a01Manager Entity
        {
            get
            {
                if (_entity == null)
                    _entity = new Sto8a01Manager();
                return _entity;
            }
        }

        #region 个人代码
        #endregion

        public override SqlApp Add(Sto8a01 sto8a01)
        {
            Sto6a00Manager.Entity.AddStorageQty(sto8a01);

            return base.Add(sto8a01);
        }

        public override SqlApp Delete(Sto8a01 sto8a01)
        {
            Sto6a00Manager.Entity.AddStorageQty(sto8a01, false);

            return base.Delete(sto8a01);
        }

        public override SqlApp Update(Sto8a01 sto8a01)
        {
            //先反记账
            var old = GetModelById(sto8a01.Dtlid);
            Sto6a00Manager.Entity.AddStorageQty(old, false);

            Sto6a00Manager.Entity.AddStorageQty(sto8a01);
            return base.Update(sto8a01);
        }

    }
}



